<template>
  <div class="app-breadcrumb">
    <a-breadcrumb>
      <a-breadcrumb-item v-for="(item, index) in breadcrumbList" :key="index">
        <router-link v-if="item.url" :to="item.url">
          {{ item.title }}
        </router-link>
      </a-breadcrumb-item>
    </a-breadcrumb>
  </div>
</template>

<script lang="ts">
import { defineComponent, computed } from 'vue'
import { useStore } from 'vuex'
import { Breadcrumb } from '/@/store/modules/app'

export default defineComponent({
  name: 'BreadCrumb',

  setup() {
    const store = useStore()

    const breadcrumbList = computed<Breadcrumb[]>(() => store.state.app.breadcrumbList)

    return {
      breadcrumbList,
    }
  },

  methods: {
    // toggleSiderBar() {
    //   alert(1)
    // }
  }
})
</script>

<style lang="scss">
.app-breadcrumb{
  display: inline-block;
  margin-left: 20px;
  .ant-breadcrumb{
    line-height: 64px;
  }
}
</style>
